﻿<!--{template admin/tpl/header}-->

<div class="mainarea">
<div class="maininner">

	<div class="bdrcontent">
		积分兑奖管理，可以在这里设置奖品相关信息。[<a href="admincp.php?ac=award">返回</a>]<br/>
		<h2>使用说明：</h2>
		<ul>
		<li>首先添加奖品分类
		<li>然后添加奖品详细信息
		</ul>
	</div>
	<br>
	
<!--{if $_GET['op']=='addp' || $_GET['op']=='editp'}-->
<script language="javascript" src="image/editor/editor_function.js"></script>
	<form method="post" action="admincp.php?ac=award&op=$_GET['op']">

	<div class="block style4">
		<table cellspacing="3" cellpadding="3" width="100%">
		<tr><th width="80">奖品分类*</th><td>
		<SELECT NAME="aid">
		<!--{eval echo getMyClass($award[aid]);}-->
		</SELECT></td></tr>
		<tr><th>卡号</th><td><input type="text" name="card" value="$award[card]" size="32"></td></tr>
		<tr><th>密码</th><td><input type="text" name="pwd" value="$award[pwd]" size="32"></td></tr>
			
		<tr><td>&nbsp;</td><td>
		<input type="hidden" name="id" value="$award[id]">
		<input type="hidden" name="oid" value="$award[aid]">
		<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
		<input type="submit" name="awardpsubmit" value="提交保存" class="submit">&nbsp;&nbsp;<input type="button" name="back" value="放弃返回" class="submit" onclick="history.back(-1);">
		</td>
		</tr>
		</table>
	</div>
	</form>
<!--{elseif $_GET['op']=='add' || $_GET['op']=='edit'}-->
<script language="javascript" src="image/editor/editor_function.js"></script>
	<form method="post" action="admincp.php?ac=award&op=$_GET['op']">

	<div class="block style4">
		<table cellspacing="3" cellpadding="3" width="100%">

		<tr><th width="80">奖品名称*</th><td><input type="text" name="award_name" value="$award[awardname]" size="60"> (支持html)</td></tr>
		<tr><th>奖品描述*</th><td>
				<textarea class="userData" name="award_description" id="uchome-ttHtmlEditor" style="height:100%;width:100%;display:none;border:0px">$award[description]</textarea>
<iframe src="editor.php?charset=$_SC[charset]&allowhtml=$allowhtml" name="uchome-ifrHtmlEditor" id="uchome-ifrHtmlEditor" scrolling="no" border="0" frameborder="0" style="width:100%;border: 1px solid #C5C5C5;" height="400"></iframe>
		</td></tr>
		<tr><th>奖品编号</th><td><input type="text" name="award_awardno" value="$award[awardno]" size="10"></td></tr>
		<tr><th>所需积分</th><td><input type="text" name="award_credit" value="$award[credit]" size="5"></td></tr>
		<tr><th>排序</th><td><input type="text" name="award_orders" value="$award[orders]" size="5"></td></tr>
		<tr><th>是否显示</th><td>是<input type="radio" name="award_isopen" {if $award[isopen]==1}checked{/if} value="1"> 否<input type="radio" name="award_isopen" {if $award[isopen]==0}checked{/if} value="0"></td></tr>
		<tbody id="image">
		<tr><th>图片地址</th><td><input type="text" name="award_awardimg" value="$award[awardimg]" size="60"></td></tr>
		</tbody>

		<tr><td>&nbsp;</td><td>
		<input type="hidden" name="award_id" value="$award[id]">
		<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
		<input type="submit" name="awardsubmit" value="提交保存" class="submit" onclick="edit_save(this);">&nbsp;&nbsp;<input type="button" name="back" value="放弃返回" class="submit" onclick="history.back(-1);">
		</td>
		</tr>
		</table>
	</div>
	</form>
<!--{elseif $_GET['op']=='list'}-->
	<form method="post" action="admincp.php?ac=award&op=delp">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">
		<div class="topactions"><a href="admincp.php?ac=award">奖品分类列表</a> | <a href="admincp.php?ac=award&op=add">添加奖品分类</a> | <a href="admincp.php?ac=award&op=addp">添加奖品</a> | <a href="admincp.php?ac=award&op=list">奖品列表</a></div>
		<div class="feed">
		<div id="feed_div" class="enter-content">
<table border="1" width="100%" id="table1" style="border-collapse: collapse" cellpadding="6" cellspacing="0" bordercolor="#CCCCCC">
	<tr>
		<td width="15%" nowrap align="center">奖品名称</td>
		<td width="15%" nowrap align="center">奖品编号</td>
		<td width="15%" nowrap align="center">所需积分</td>
		<td width="15%" nowrap align="center">卡号</td>
		<td width="15%" nowrap align="center">密码</td>
		<td width="15%" nowrap align="center">状态</td>
		<td width="10%" colspan="2" nowrap align="center">操作</td>
	</tr>
	<!--{loop $plist $value}-->
	<tr>
		<td width="15%" nowrap><input type="checkbox" value="$value[id]" name="ids[]">$value[awardname]</td>
		<td width="15%" nowrap align="center">$value[awardno]</td>
		<td width="15%" nowrap align="center">$value[credit]</td>
		<td width="15%" nowrap align="center">$value[card]</td>
		<td width="15%" nowrap align="center">$value[pwd]</td>
		<td width="15%" nowrap align="center"><!--{if $value[isused]==1}-->已兑换 <a href="space.php?uid=$value[uid]" target="_blank" title="查看兑换者详细信息">$value[uid]</a><!--{else}-->未兑换<!--{/if}--></td>
		<td width="5%" nowrap align="center"><!--{if $value[isused]==0}--><a href="admincp.php?ac=award&op=editp&id=$value[id]">编辑</a><!--{else}-->编辑<!--{/if}--></td>
		<td width="5%" nowrap align="center"><a href="admincp.php?ac=award&op=delp&id=$value[id]" onclick="return confirm('确定删除此奖品？');">删除</a></td>
	</tr>
			<!--{/loop}-->
				</tr>
			</table>
		</div>
		</div>
	</div>
	<div class="footactions">
		<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">全选 
		<input type="hidden" name="mpurl" value="$mpurl">
		<input type="submit" name="deletesubmit" value="批量删除" onclick="return confirm('本操作不可恢复，确认删除？');" class="submit">

		<div class="pages">$multi</div>
	</div>

	</form>
<!--{else}-->
	<form method="post" action="admincp.php?ac=award&op=del">
	<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
	<div class="bdrcontent">
		<div class="topactions"><a href="admincp.php?ac=award">奖品分类列表</a> | <a href="admincp.php?ac=award&op=add">添加奖品分类</a> | <a href="admincp.php?ac=award&op=addp">添加奖品</a> | <a href="admincp.php?ac=award&op=list">奖品列表</a></div>
		<div class="feed">
		<div id="feed_div" class="enter-content">
<table border="1" width="100%" id="table1" style="border-collapse: collapse" cellpadding="6" cellspacing="0" bordercolor="#CCCCCC">
	<tr>
		<td width="15%" nowrap align="center">奖品名称</td>
		<td width="15%" nowrap align="center">奖品编号</td>
		<td width="15%" nowrap align="center">剩余数量</td>
		<td width="15%" nowrap align="center">已兑换数量</td>
		<td width="15%" nowrap align="center">所需积分</td>
		<td width="15%" nowrap align="center">是否显示</td>
		<td width="15%" nowrap align="center">排序</td>
		<td width="10%" colspan="2" nowrap align="center">操作</td>
	</tr>
	<!--{loop $award $value}-->
	<tr>
		<td width="15%" nowrap><input type="checkbox" value="$value[id]" name="ids[]">$value[awardname]</td>
		<td width="15%" nowrap align="center">$value[awardno]</td>
		<td width="15%" nowrap align="center">$value[remain]</td>
		<td width="15%" nowrap align="center">$value[exchange]</td>
		<td width="15%" nowrap align="center">$value[credit]</td>
		<td width="15%" nowrap align="center">{if $value[isopen] == 1}是{else}否{/if}</td>
		<td width="15%" nowrap align="center">$value[orders]</td>
		<td width="5%" nowrap align="center"><a href="admincp.php?ac=award&op=edit&id=$value[id]">编辑</a></td>
		<td width="5%" nowrap align="center"><a href="admincp.php?ac=award&op=del&id=$value[id]" onclick="return confirm('确定删除此奖品？');">删除</a></td>
	</tr>
			<!--{/loop}-->
				</tr>
			</table>
		</div>
		</div>
	</div>
	<div class="footactions">
		<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">全选 
		<input type="hidden" name="mpurl" value="$mpurl">
		<input type="submit" name="deletesubmit" value="批量删除" onclick="return confirm('本操作将删除此分类下所有奖品并且不可恢复，确认删除？');" class="submit">

		<div class="pages">$multi</div>
	</div>

	</form>

<!--{/if}-->
</div>
</div>

<div class="side">
	<!--{template admin/tpl/side}-->
</div>

<!--{template admin/tpl/footer}-->